home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Source / GNU / cc / expmed.diff < prev    next >
Text File  |  1994-04-13  |  8KB  |  237 lines

  1. *** expmed.c    Fri Apr  8 10:07:44 1994
  2. --- expmed.c.next    Fri Apr  1 12:53:32 1994
  3. ***************
  4. *** 421,429 ****
  5.         /* If xop0 is a register, we need it in MAXMODE
  6.        to make it acceptable to the format of insv.  */
  7.         if (GET_CODE (xop0) == SUBREG)
  8. !     /* We can't just change the mode, because this might clobber op0,
  9. !        and we will need the original value of op0 if insv fails.  */
  10. !     xop0 = gen_rtx (SUBREG, maxmode, SUBREG_REG (xop0), SUBREG_WORD (xop0));
  11.         if (GET_CODE (xop0) == REG && GET_MODE (xop0) != maxmode)
  12.       xop0 = gen_rtx (SUBREG, maxmode, xop0, 0);
  13.   
  14. --- 421,427 ----
  15.         /* If xop0 is a register, we need it in MAXMODE
  16.        to make it acceptable to the format of insv.  */
  17.         if (GET_CODE (xop0) == SUBREG)
  18. !     PUT_MODE (xop0, maxmode);
  19.         if (GET_CODE (xop0) == REG && GET_MODE (xop0) != maxmode)
  20.       xop0 = gen_rtx (SUBREG, maxmode, xop0, 0);
  21.   
  22. ***************
  23. *** 517,533 ****
  24.     int all_zero = 0;
  25.     int all_one = 0;
  26.   
  27. -   /* If VALUE is a floating-point mode, access it as an integer of the
  28. -      corresponding size.  This can occur on a machine with 64 bit registers
  29. -      that uses SFmode for float.  This can also occur for unaligned float
  30. -      structure fields.  */
  31. -   if (GET_MODE_CLASS (GET_MODE (value)) == MODE_FLOAT)
  32. -     {
  33. -       if (GET_CODE (value) != REG)
  34. -     value = copy_to_reg (value);
  35. -       value = gen_rtx (SUBREG, word_mode, value, 0);
  36. -     }
  37.     /* There is a case not handled here:
  38.        a structure with a known alignment of just a halfword
  39.        and a field split across two aligned halfwords within the structure.
  40. --- 515,520 ----
  41. ***************
  42. *** 569,584 ****
  43.   
  44.         total_bits = GET_MODE_BITSIZE (mode);
  45.   
  46. -       /* Make sure bitpos is valid for the chosen mode.  Adjust BITPOS to
  47. -      be be in the range 0 to total_bits-1, and put any excess bytes in
  48. -      OFFSET.  */
  49. -       if (bitpos >= total_bits)
  50. -     {
  51. -       offset += (bitpos / total_bits) * (total_bits / BITS_PER_UNIT);
  52. -       bitpos -= ((bitpos / total_bits) * (total_bits / BITS_PER_UNIT)
  53. -              * BITS_PER_UNIT);
  54. -     }
  55.         /* Get ref to an aligned byte, halfword, or word containing the field.
  56.        Adjust BITPOS to be position within a word,
  57.        and OFFSET to be the offset of that word.
  58. --- 556,561 ----
  59. ***************
  60. *** 633,638 ****
  61. --- 610,626 ----
  62.   
  63.         if (GET_MODE (value) != mode)
  64.       {
  65. +       /* If VALUE is a floating-point mode, access it as an integer
  66. +          of the corresponding size, then convert it.  This can occur on
  67. +          a machine with 64 bit registers that uses SFmode for float.  */
  68. +       if (GET_MODE_CLASS (GET_MODE (value)) == MODE_FLOAT)
  69. +         {
  70. +           if (GET_CODE (value) != REG)
  71. +         value = copy_to_reg (value);
  72. +           value
  73. +         = gen_rtx (SUBREG, word_mode, value, 0);
  74. +         }
  75.         if ((GET_CODE (value) == REG || GET_CODE (value) == SUBREG)
  76.             && GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (value)))
  77.           value = gen_lowpart (mode, value);
  78. ***************
  79. *** 703,709 ****
  80.       {
  81.         rtx word = gen_lowpart_common (word_mode, value);
  82.   
  83. !       if (word && (value != word))
  84.       value = word;
  85.         else
  86.       value = gen_lowpart_common (word_mode,
  87. --- 691,697 ----
  88.       {
  89.         rtx word = gen_lowpart_common (word_mode, value);
  90.   
  91. !       if (word)
  92.       value = word;
  93.         else
  94.       value = gen_lowpart_common (word_mode,
  95. ***************
  96. *** 733,751 ****
  97.                >> (bitsize - bitsdone - thissize))
  98.               & (((HOST_WIDE_INT) 1 << thissize) - 1));
  99.         else
  100. !     {
  101. !       /* The args are chosen so that the last part
  102. !          includes the lsb.  */
  103. !       int bit_offset = 0;
  104. !       /* If the value isn't in memory, then it must be right aligned
  105. !          if a register, so skip past the padding on the left.  If it
  106. !          is in memory, then there is no padding on the left.  */
  107. !       if (GET_CODE (value) != MEM)
  108. !         bit_offset = BITS_PER_WORD - bitsize;
  109. !       part = extract_fixed_bit_field (word_mode, value, 0, thissize,
  110. !                       bit_offset + bitsdone,
  111. !                       NULL_RTX, 1, align);
  112. !     }
  113.   #else
  114.         /* Fetch successively more significant portions.  */
  115.         if (GET_CODE (value) == CONST_INT)
  116. --- 721,731 ----
  117.                >> (bitsize - bitsdone - thissize))
  118.               & (((HOST_WIDE_INT) 1 << thissize) - 1));
  119.         else
  120. !     /* The args are chosen so that the last part
  121. !        includes the lsb.  */
  122. !     part = extract_fixed_bit_field (word_mode, value, 0, thissize,
  123. !                     BITS_PER_WORD - bitsize + bitsdone,
  124. !                     NULL_RTX, 1, align);
  125.   #else
  126.         /* Fetch successively more significant portions.  */
  127.         if (GET_CODE (value) == CONST_INT)
  128. ***************
  129. *** 757,776 ****
  130.   #endif
  131.   
  132.         /* If OP0 is a register, then handle OFFSET here.
  133. !      When handling multiword bitfields, extract_bit_field may pass
  134. !      down a word_mode SUBREG of a larger REG for a bitfield that actually
  135. !      crosses a word boundary.  Thus, for a SUBREG, we must find
  136. !      the current word starting from the base register.  */
  137. !       if (GET_CODE (op0) == SUBREG)
  138.       {
  139. -       word = operand_subword (SUBREG_REG (op0),
  140. -                   SUBREG_WORD (op0) + offset, 1,
  141. -                   GET_MODE (SUBREG_REG (op0)));
  142. -       offset = 0;
  143. -     }
  144. -       else if (GET_CODE (op0) == REG)
  145. -     {
  146.         word = operand_subword (op0, offset, 1, GET_MODE (op0));
  147.         offset = 0;
  148.       }
  149. --- 737,745 ----
  150.   #endif
  151.   
  152.         /* If OP0 is a register, then handle OFFSET here.
  153. !      In the register case, UNIT must be a whole word.  */
  154. !       if (GET_CODE (op0) == SUBREG || GET_CODE (op0) == REG)
  155.       {
  156.         word = operand_subword (op0, offset, 1, GET_MODE (op0));
  157.         offset = 0;
  158.       }
  159. ***************
  160. *** 928,942 ****
  161.           emit_move_insn (target_part, result_part);
  162.       }
  163.   
  164. !       if (unsignedp)
  165. !     return target;
  166. !       /* Signed bit field: sign-extend with two arithmetic shifts.  */
  167. !       target = expand_shift (LSHIFT_EXPR, mode, target,
  168. !                  build_int_2 (GET_MODE_BITSIZE (mode) - bitsize, 0),
  169. !                  NULL_RTX, 0);
  170. !       return expand_shift (RSHIFT_EXPR, mode, target,
  171. !                build_int_2 (GET_MODE_BITSIZE (mode) - bitsize, 0),
  172. !                NULL_RTX, 0);
  173.       }
  174.     
  175.     /* From here on we know the desired field is smaller than a word
  176. --- 897,903 ----
  177.           emit_move_insn (target_part, result_part);
  178.       }
  179.   
  180. !       return target;
  181.       }
  182.     
  183.     /* From here on we know the desired field is smaller than a word
  184. ***************
  185. *** 1524,1543 ****
  186.         thissize = MIN (thissize, unit - thispos);
  187.   
  188.         /* If OP0 is a register, then handle OFFSET here.
  189. !      When handling multiword bitfields, extract_bit_field may pass
  190. !      down a word_mode SUBREG of a larger REG for a bitfield that actually
  191. !      crosses a word boundary.  Thus, for a SUBREG, we must find
  192. !      the current word starting from the base register.  */
  193. !       if (GET_CODE (op0) == SUBREG)
  194.       {
  195. -       word = operand_subword_force (SUBREG_REG (op0),
  196. -                     SUBREG_WORD (op0) + offset,
  197. -                     GET_MODE (SUBREG_REG (op0)));
  198. -       offset = 0;
  199. -     }
  200. -       else if (GET_CODE (op0) == REG)
  201. -     {
  202.         word = operand_subword_force (op0, offset, GET_MODE (op0));
  203.         offset = 0;
  204.       }
  205. --- 1485,1493 ----
  206.         thissize = MIN (thissize, unit - thispos);
  207.   
  208.         /* If OP0 is a register, then handle OFFSET here.
  209. !      In the register case, UNIT must be a whole word.  */
  210. !       if (GET_CODE (op0) == SUBREG || GET_CODE (op0) == REG)
  211.       {
  212.         word = operand_subword_force (op0, offset, GET_MODE (op0));
  213.         offset = 0;
  214.       }
  215. ***************
  216. *** 1642,1655 ****
  217.   
  218.     op1 = expand_expr (amount, NULL_RTX, VOIDmode, 0);
  219.   
  220. - #if SHIFT_COUNT_TRUNCATED
  221. -   if (SHIFT_COUNT_TRUNCATED
  222. -       && GET_CODE (op1) == CONST_INT
  223. -       && (unsigned HOST_WIDE_INT) INTVAL (op1) >= GET_MODE_BITSIZE (mode))
  224. -     op1 = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (op1)
  225. -            % GET_MODE_BITSIZE (mode));
  226. - #endif
  227.     if (op1 == const0_rtx)
  228.       return shifted;
  229.   
  230. --- 1592,1597 ----
  231.